package com.richfit.cuba.modular.common.impl;

import org.springframework.beans.factory.annotation.Value;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.richfit.cuba.modular.common.CommonMapper;
import com.richfit.cuba.modular.common.ICommonService;

public class CommonServiceImpl<M extends CommonMapper<T>, T> extends ServiceImpl<M, T> implements ICommonService<T> {

	@Value("${interval.year:3}")
	private int intervalYear;
	
	@Override
	public IPage<T> getCustomerPage(Page<T> page, Wrapper<T> entity) {
//		int year = CommonUtil.getEffectiveYear(intervalYear*-1);
		return this.baseMapper.getCustomerPage(page, entity, intervalYear);
	}

}
